//
//  UIBarButtonItem + Button.swift
//  iOSwechat
//
//  Created by apple on 16/3/1.
//  Copyright © 2016年 apple. All rights reserved.
//

import UIKit
extension UIBarButtonItem{

    //方法三
    convenience init(image:String)  {
        let button = UIButton()
        button.setImage(UIImage(named: image), forState: UIControlState.Normal)
        button.setImage(UIImage(named: image + "_highlighted"), forState: UIControlState.Highlighted)
        button.sizeToFit()
        self.init(customView:button)
    }
    
}